<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/5/16
  Time: 10:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>

    <link rel="stylesheet" href="${pageContext.request.contextPath}/res/jstree/themes/default/style.min.css" />
</head>
<body>
<div id="jstree_demo_div">
    <ul>
        <li>Root node 1</li>
        <li>Root node 2</li>
    </ul>
</div>

<script src="${pageContext.request.contextPath}/res/js/jquery-2.1.4.min.js">
</script>
<script src="${pageContext.request.contextPath}/res/jstree/jstree.min.js"></script>

<script>
    $(function () {
        $('#jstree_demo_div').jstree();

        $('#jstree_demo_div').on("changed.jstree", function (e, data) {
            console.log(data.selected);
        });

        $('button').on('click', function () {
            $('#jstree').jstree(true).select_node('child_node_1');
            $('#jstree').jstree('select_node', 'child_node_1');
            $.jstree.reference('#jstree').select_node('child_node_1');
        })
    } );
</script>
</body>
</html>
